<?xml version="1.0"?>
<jsp:root 	xmlns:jsp="http://java.sun.com/JSP/Page"
 			xmlns:c="http://java.sun.com/jsp/jstl/core"
 			xmlns="http://www.w3.org/1999/xhtml"
 			version="2.1">
 
 <jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
 <jsp:directive.page isELIgnored="false" />
 <jsp:output 	omit-xml-declaration="false" 
 			 	doctype-root-element="HTML" 
 				doctype-system="about:legacy-compat" />
 
 <jsp:useBean id="datosLogin" class="es.javamyadmin.beans.LoginBean" scope="session" />
 
 <jsp:useBean id="listaTablesBean" class="es.javamyadmin.beans.ListaTablesBean" scope="session" />

<html>
<head>

<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/java-admin.css" media="screen" />

<title>JavaMyAdmin</title>

</head>

<body>

<div id="contenedor">
	
	<jsp:include page="../includes/sidebar-left.jsp" />
	
	<div id="contenido">
	
		<jsp:include page="../includes/cabecera.jsp" />
		
		<h2>Database <c:out value="${listaTablesBean.database}"></c:out></h2>
		
		<!-- Errores -->
		<c:if test="${error!=null}"><div class="aviso"><div class="pro_aviso ko"><p><c:out value="${error}"></c:out></p></div></div></c:if>
		
		<c:if test="${ok!=null}"><div class="aviso"><div class="pro_aviso ok"><p><c:out value="${ok}"></c:out></p></div></div></c:if>
		
		<form action="#" method="post">
			<table id="crearTabla">
				<tr>
					<th>Nombre</th>
					<th>Tipo</th>
					<th>Longitud</th>
					<th>Predeterminado</th>
					<th>Atributos</th>
					<th>Nulo</th>
					<th>Indice</th>
					<th>A_I</th>
				</tr>
			
				<c:forEach var="i" begin="1" end="${param.numCampos }">
				   	<tr>
				   		<td align="center"><input class="campo" type="text" name="nombreCampo${i}"/></td>
				   		<td align="center">
				   			<select class="campo" style="width: 130px;" name="tipo${i}">
				   				<option value="VARCHAR">VARCHAR</option>
				   				<option value="TINYINT">TINYINT</option>
				   				<option value="TEXT">TEXT</option>
				   				<option value="DATE">DATE</option>
				   				<option value="SMALLINT">SMALLINT</option>
				   				<option value="MEDIUMINT">MEDIUMINT</option>
				   				<option value="INT">INT</option>
				   				<option value="BIGINT">BIGINT</option>
				   				<option value="FLOAT">FLOAT</option>
				   				<option value="DOUBLE">DOUBLE</option>
				   				<option value="DECIMAL">DECIMAL</option>
				   				<option value="DATETIME">DATETIME</option>
				   				<option value="TIMESTAMP">TIMESTAMP</option>
				   				<option value="TIME">TIME</option>
				   				<option value="YEAR">YEAR</option>
				   				<option value="DOUBLE">DOUBLE</option>
				   				<option value="CHAR">CHAR</option>
				   				<option value="TINYBLOB">TINYBLOB</option>
				   				<option value="TINYTEXT">TINYTEXT</option>
				   				<option value="BLOB">BLOB</option>
				   				<option value="MEDIUMBLOD">MEDIUMBLOD</option>
				   				<option value="MEDIUMTEXT">MEDIUMTEXT</option>
				   				<option value="LONGBLOB">LONGBLOB</option>
				   				<option value="LONGTEXT">LONGTEXT</option>
				   				<option value="ENUM">ENUM</option>
				   				<option value="SET">SET</option>
				   			</select>
				   		</td>
				   		<td align="center"><input class="campo" style="width: 40px;" type="text" name="longitud${i}"/></td>
				   		<td align="center">Item <c:out value="${i}"/></td>
				   		<td align="center">
				   			<select class="campo" name="atributos${i}">
				   				<option value="BINARY">BINARY</option>
				   				<option value="UNSIGNED">UNSIGNED</option>
				   				<option value="UNSIGNED ZEROFILL">UNSIGNED ZEROFILL</option>
				   			</select>
				   		</td>
				   		<td align="center"><input type="checkbox" name="nulo${i}"/></td>
				   		<td align="center">Item <c:out value="${i}"/></td>
				   		<td align="center"><input type="checkbox" name="a_i${i}"/></td>
				   	</tr>
				</c:forEach>
					<tr>
						<td colspan="8" align="left"><input class="boton" type="submit" value="CREAR TABLA"/></td>
					</tr>
		 	</table>
	 	</form>	
	</div>

</div>

</body>
</html>
</jsp:root>